<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>
      Shoppe商城-综合网购首选-正品低价、品质保证、配送及时、轻松购物
    </title>
    <link rel="icon" href="./static/img/common/favicon.ico" />
    <link rel="stylesheet" href="./css/base.css" />
    <link rel="stylesheet" href="./css/common.css" />
    <link rel="stylesheet" href="./css/order.css" />
    <script src="jquery/jquery-3.6.0.js"></script>
    <script>
      $(function () {
        //返回购物车
        $(".button1").click(function () {
          location.href = "${basePath}cart.jsp";
        });
        $(".button2").click(function () {
          location.href = "${basePath}orderServlet?action=createOrder";
        });
      });
    </script>
  </head>
  <body>
  <!-- 顶部模块start -->
  <%@include file="page/common/top.jsp"%>
  <!-- 顶部模块end -->
  <!-- nav 搜索模块start -->
  <%@include file="page/common/search.jsp"%>
  <!-- nav 搜索模块end -->
    <!-- 标题 start -->
    <div class="title">
      <div class="w">
        <img src="./static/img/order/order.png" alt="" /><em>确认订单</em>
      </div>
    </div>
    <!-- 标题 end -->
    <!-- 订单 start -->
    <div class="w clearfix">
      <div class="order clearfix">
        <div class="one clearfix">
            <p class="first-p">收货地址</p>
        <ul>
            <li>
                <p class="name">姓名:${sessionScope.user.username}</p>
                <p class="phone">电话:${sessionScope.user.phone}</p>
                <p class="address">地址:广东 广州市 白云区 江高镇</p>
            </li>
            <li>
                <p class="name">姓名</p>
                <p class="phone">电话</p>
                <p class="address">广东 广州市 白云区 江高镇</p>
            </li>
            <li class="new-address">
                <p><img src="static/img/order/add.png" alt=""></p>
                <p>添加新地址</p>
            </li>
        </ul>
        </div>
        <div class="two">
            <p class="second-p">商品及优惠券</p>
        </div>
        <div class="three">
            <ul>
                <li>

                    <span class="span1">商品名称</span>
                    <span class="span2">价格X数量</span>
                    <span class="span3"></span>
                    <span class="span4">小计</span>
                </li>
              <c:forEach items="${sessionScope.cart.items}" var="item">
                <li>
                  <img src="${item.value.imgPath}" alt="商品图片">
                  <span class="span1">${item.value.name}</span>
                  <span class="span2">${item.value.price}元X${item.value.count}</span>
                  <span class="span3"></span>
                  <span class="span4">${item.value.totalPrice}</span>
                </li>
              </c:forEach>
            </ul>
        </div>
        <div class="four">
            <p class="p1">配送方式</p>
            <p class="p2">包邮</p>
        </div>
        <div class="five">
            <p class="p1">发票</p>
            <p class="p2">电子发票</p>
            <p class="p3">个人</p>
            <p class="p4">商品明细</p>
        </div>
        <div class="six">
            <div><span class="right">${sessionScope.cart.totalCount}件</span><span class="left">商品件数：</span></div>
            <div><span class="right">${sessionScope.cart.totalPrice}元</span><span class="left">商品总价：</span></div>
            <div><span class="right">0元</span><span class="left">活动优惠：</span></div>
            <div><span class="right">0元</span><span class="left">优惠券抵扣：</span></div>
            <div><span class="right">0元</span><span class="left">运费：</span></div>
            <div><span class="right2"><em>${sessionScope.cart.totalPrice}元</em></span><span class="left2">应付总额：</span></div>
        </div>
        <div class="seven">
            <div class="button2">结算</div>
            <div class="button1">返回购物车</div>
        </div>
      </div>
    </div>
    <!-- 订单 end -->
    <!-- 页脚开始 -->
    <%@include file="page/common/bottom.jsp"%>
    <!-- 页脚结束 -->
    <script src="js/common.js"></script>
  </body>
</html>
